import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App.tsx";
import "./indexdb.ts";
import { getDB } from "./indexdb.ts";
import { AppProvider } from "./components/provider/index.tsx";

async function boot() {
  const db = await getDB();

  if (db) {
    createRoot(document.getElementById("root")!).render(
      <StrictMode>
        <AppProvider db={db}>
          <App />
        </AppProvider>
      </StrictMode>
    );
  }
}

boot();
